package cn.stylefeng.guns.modular.basic.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.basic.entity.BasicPosition;
import cn.stylefeng.guns.modular.basic.model.params.BasicGoodsParam;
import cn.stylefeng.guns.modular.basic.model.params.BasicOperateParam;
import cn.stylefeng.guns.modular.basic.model.params.BasicPositionParam;
import cn.stylefeng.guns.modular.basic.model.result.BasicPositionResult;
import cn.stylefeng.guns.modular.storage.entity.Kfsum;
import cn.stylefeng.roses.core.reqres.response.ResponseData;

import com.baomidou.mybatisplus.extension.service.IService;

import java.io.IOException;
import java.util.List;

import org.springframework.web.multipart.MultipartFile;

/**
 * 库位表 服务类
 */
public interface BasicPositionService extends IService<BasicPosition> {

    /**
     * 新增
     */
    void add(BasicPositionParam param);

    /**
     * 删除
     */
    void delete(BasicPositionParam param);

    /**
     * 更新
     */
    void update(BasicPositionParam param);

    /**
     * 查询单条数据，Specification模式
     */
    BasicPositionResult findBySpec(BasicPositionParam param,Long deptId, Long operateId);

    /**
     * 查询列表，Specification模式
     */
    List<BasicPositionResult> findListBySpec(BasicPositionParam basicPositionParam,String condition,Long deptId,Long warehouseId,Long operateId);

    /**
     * 查询分页数据，Specification模式
     */
     LayuiPageInfo findPageBySpec(BasicPositionParam param,String condition,Long deptId,Long WarehouseId,Long operateId);

 	LayuiPageInfo findStoragelistPageBySpec(BasicPositionParam param, String condition, Long deptId,
 			Long warehouseId);
     
	 /**
      * 物料编号匹配库位
      * @param bigtype
      * @param goodsnumber
      * @return
      */
     List<BasicPositionResult> findListByMaterial(String bigtype, String goodsnumber, BasicPositionParam basicPositionParam,
			Long deptId,Long warehouseId,Long goodsId,String detailedDateofmanufacture,Long operateId);

     LayuiPageInfo positionListBySpec(BasicPositionParam param, String condition, Long deptId,
			Long intersectionId);

     /**
      * 物料匹配空库位
      * @param bigtype
      * @param goodsnumber
      * @param basicPositionParam
      * @param deptId
      * @param warehouseId
      * @return
      */
	List<BasicPositionResult> findEmptyList(String bigtype, String goodsnumber, BasicPositionParam basicPositionParam,
			Long deptId, Long warehouseId,String putSupportnum,Long operateId);

	/**
	 * 匹配有相同批次库位
	 * @param bigtype
	 * @param goodsnumber
	 * @param basicPositionParam
	 * @param deptId
	 * @param warehouseId
	 * @param goodsId
	 * @param recommend
	 * @return
	 */
	List<BasicPositionResult> findListByIdentical(String bigtype, String goodsnumber,
			BasicPositionParam basicPositionParam, Long deptId, Long warehouseId, Long goodsId, String recommend,Long operateId);

	ResponseData getExceldata(MultipartFile file, BasicPositionParam basicPositionParam, ResponseData data) throws IOException;

	ResponseData getExceldataUpdate(MultipartFile file, BasicPositionParam basicPositionParam, ResponseData data) throws IOException;
	
	boolean saveBatchList(List<BasicPositionParam> list);

	List<Kfsum> findkfsum( BasicPositionParam basicPositionParam);

	List<BasicPositionResult> ChouPanFindListBySpec(BasicPositionParam basicPositionParam, Long deptId,Long operateId);

	BasicPositionResult sumPositionStorage(Long warehouseId);

	BasicPositionResult sumPositionStorageYsumP(Long customerId,Long warehouseId);

	BasicPositionResult sumPositionStorageKsumP(Long customerId,Long warehouseId);

	BasicPositionResult sumPositionStorageDsumPt(Long warehouseId);

	BasicPositionResult sumPositionStorageYsumPt(Long customerId,Long warehouseId);

	/**
	 * 查询绑定该商品的拣货位
	 * @param bangding
	 * @return
	 */
	BasicPositionResult findBangDingBySpec(BasicPositionParam bangding);

	/**
	 * 查询未绑定商品的空拣货位
	 * @param kongp
	 * @return
	 */
	BasicPositionResult findKongBySpec(BasicPositionParam kongp);

	Integer addReturnId(BasicPositionParam param);

	List<BasicPositionResult> findlistAllBySpec(BasicPositionParam basicPositionParam, String condition, Long deptId,
			Long warehouseId, Long operateId);

	List<BasicPositionResult> listJhwOrderByNum(BasicPositionParam basicPositionParam);
}
